package com.itheima.HomeWork.homework01;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class DemoArrayListNames {
    public static void main(String[] args) {
        List<String> one = new ArrayList<>();
        one.add("黄老邪");
        one.add("陈玄风");
        one.add("梅超风");
        one.add("陆乘风");
        one.add("曲灵风");
        one.add("武眠风");
        one.add("冯默风");
        one.add("罗玉风");
        List<String> two = new ArrayList<>();
        two.add("张三丰");
        two.add("宋远桥");
        two.add("俞莲舟");
        two.add("俞岱岩");
        two.add("张松溪");
        two.add("张翠山");
        two.add("殷梨亭");
        two.add("莫声谷");
		// ....
        one.stream().filter(s->s.length()==3).forEach(s-> System.out.println(s));
        System.out.println("-------------------------");
        one.stream().limit(3).forEach(s -> System.out.println(s));
        System.out.println("-------------------------");
        two.stream().filter(s -> s.startsWith("张")).forEach(s -> System.out.println(s));
        System.out.println("-------------------------");
        two.stream().skip(2).forEach(s -> System.out.println(s));
        System.out.println("--------------//-----------");
        Stream<String> stream = one.stream();
        Stream<String> stream1 = two.stream();
        Stream<Person> personStream = Stream.concat(stream, stream1).map(s -> new Person(s));

        personStream.forEach(s-> System.out.println(s));


    }
}